/**
 *
 */
package de.cbf.cam.dsa.rcp.model.entities;

import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;

import de.cbf.util.uuidheader.entities.EntityWeighted;
import de.cbf.util.uuidheader.entities.NamedEntity;

/**
 * @author salter
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
public class PerkDSA extends EntityWeighted {

	public static final String ATTRIBUTE_ROYAL = "royal";

	protected Boolean required;

	protected List<String> parameters = new ArrayList<String>(); //for "sub"-perks(Sprachfehler:lispelt")

	protected List<String> attributes = new ArrayList<String>();
	/**
	 *
	 */
	public PerkDSA() {

	}

	/**
	 * @param entity
	 * @param weight
	 */
	public PerkDSA(NamedEntity entity, Double weight,Boolean required) {
		super(entity, weight);
		this.required = required;
	}

	public void addAttribute(String attribute){
		attributes.add(attribute);
	}

	public boolean hasAttribute(String string) {
		for (String attribute : attributes) {
			if(attribute.equals(string)){
				return true;
			}
		}
		return false;
	}

	public boolean removeAttribute(String attribute){
		return attributes.remove(attribute);
	}

	public Boolean getRequired() {
		return required;
	}

	public void setRequired(Boolean required) {
		this.required = required;
	}



}
